import Utils from "../Utils";

export default class GateCfg{
    public id:number;
    public len:number;
    public zhuzi=[];
    public award:string;
    public isSp:boolean=false;
    constructor(data=null,isSp:boolean=false){
        this.isSp=isSp;
        if(data)this.parse(data)
    }

    public parse(data,isSp:boolean=false){
        Utils.copyObjAtt(this,data);
    }

    public getAward1Num(){
        let tnum=parseInt(this.award.split("-")[1]);
        return tnum;
    }

    public getLevelStr(){
        if(this.isSp)return "SPECIAL LEVEL";
        return "第 "+this.id + " 关";
    }
}